$OpenBSD: patch-common_include_zarafa_platform_linux_h,v 1.2 2016/04/20 18:38:41 robert Exp $
--- common/include/zarafa/platform.linux.h.orig	Wed Apr 20 13:13:54 2016
+++ common/include/zarafa/platform.linux.h	Wed Apr 20 19:54:13 2016
@@ -32,7 +32,14 @@
 #include <dlfcn.h>
 #include <cstddef>
 #include <libgen.h>
+#if defined(__OpenBSD__)
+#include <sys/param.h>
+#ifndef MAX_PATH
+  #define MAX_PATH PATH_MAX
+#endif
+#else
 #include <byteswap.h>
+#endif
 #include <endian.h>
 #include <cerrno>
 #include <clocale>
@@ -66,6 +73,8 @@
 #define _snprintf snprintf
 #ifdef HAVE_VSNPRINTF_L
 #define _vsnprintf_l vsnprintf_l
+#elif defined __OpenBSD__
+#define _vsnprintf_l vsnprintf
 #else
 inline int _vsnprintf_l(char *str, size_t size, const char *format, locale_t locale, va_list ap) {
 	locale_t prev = uselocale(locale);
@@ -654,7 +663,11 @@ time_t GetProcessTime();
 
 #ifndef ntohll
 	#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef __OpenBSD__
 		#define ntohll(x) __bswap_64(x)
+#else
+		#define ntohll(x) __swap64(x)
+#endif // __OpenBSD__
 	#else
 		#define ntohll(x) (x)
 	#endif
@@ -662,14 +675,18 @@ time_t GetProcessTime();
 
 #ifndef htonll
 	#if __BYTE_ORDER == __LITTLE_ENDIAN
+#ifndef __OpenBSD__
 		#define htonll(x) __bswap_64(x)
+#else
+		#define htonll(x) __swap64(x)
+#endif // __OpenBSD__
 	#else
 		#define htonll(x) (x)
 	#endif
 #endif
 
 #define OutputDebugStringA(dstr) fprintf(stderr,"%s",dstr)
-#define GetCurrentThreadId() (int)pthread_self()
+#define GetCurrentThreadId() (intptr_t)pthread_self()
 #define GetTickCount() 0L
 
 #define TICKS_PER_SEC (sysconf(_SC_CLK_TCK))
